/**
 * JAVACC DEMO 1.0
 * @copy right dwusoft company All rights reserved. 
 * @Package com.apache.bid.service.cacheplugins  
 */
package com.apache.bid.service.cacheplugins;

import com.apache.api.manager.PluginConnector;
import com.apache.api.manager.ProxyManager;
import com.apache.api.vo.ParamsVo;
import com.apache.api.vo.ResultEntity;
import com.apache.bid.entity.BidItem;
import com.apache.cache.util.Validator;

/**
 * description:  恢复item信息
 * @author Hou Dayu 创建时间：2016-3-23  
 * 
 */
public class RestoreItemPluginImpl implements PluginConnector {

	private ProxyManager wbdProxyCacheManager;

	/**
	 * TODO 简单描述该方法的实现功能（可选）.  
	 * @see com.zbxsoft.api.manager.PluginConnector#execute(com.zbxsoft.api.vo.ParamsVo)  
	 */
	public Object execute(ParamsVo param) throws Exception {
		String itemId = Validator.getDefaultStr(param.getInfoId(), String.valueOf(param.getParams("infoId")));
		ResultEntity entity = new ResultEntity();
		if (Validator.isNull(itemId)) {
			entity.setResult("false");
			entity.setMessage("缺少方法参数,方法执行失败");
		} else {
			ParamsVo<BidItem> vo = new ParamsVo<BidItem>();
			vo.setInfoId(itemId);
			vo.setParams("firstBidTime", param.getParams("firstBidTime"));
			vo.setKey("restoreItem");
			entity = (ResultEntity) wbdProxyCacheManager.saveInvoke(vo);
			return entity;
		}
		return entity;
	}

	public void setWbdProxyCacheManager(ProxyManager wbdProxyCacheManager) {
		this.wbdProxyCacheManager = wbdProxyCacheManager;
	}

}
